<template>
  <div class="container">
    <h1>温州理工滨海校区</h1>
    <input type="text" v-model="studentId" placeholder="请输入学号">
    <button @click="searchStudent">搜索</button>
    <div v-if="studentInfo">
      <p>姓名：{{ studentInfo.name }}</p>
      <p>年龄：{{ studentInfo.age }}</p>
      <p>性别：{{ studentInfo.gender }}</p>
      <p>专业：{{ studentInfo.major }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      studentId: '',
      studentInfo: null
    };
  },
  methods: {
    searchStudent() {
      // 模拟根据学号查询学生信息的功能
      // 实际开发中应该调用接口获取数据
      if (this.studentId === '22219111441') {
        this.studentInfo = {
          name: '谢小甩',
          age: 21,
          gender: '男',
          major: '计算机科学与技术'
        };
      } else {
        alert('未找到该学生信息');
      }
    }
  }
};
</script>

<style scoped>
.container {
  margin: 20px;
}
</style>